<template>
  <div class="user-set" style="width: 92%;margin-left:4%;">
    <UserSet v-if="data">
      <p @click="$router.push('/usersafe')" slot="zhanghao">账号与安全 <span class="da">&gt;</span></p>
      <p slot="edit">资料编辑 <span class="da">&gt;</span></p>
      <p slot="neicun">清除缓存 <span>2.00KB</span></p>
      <p slot="yijian">意见反馈 <span class="da">&gt;</span></p>
      <button @click="superstratum = true" slot="button">退出登录</button>
    </UserSet>
    <UserSet v-else>
      <p slot="neicun">清除缓存<span>1.00KB</span></p>
    </UserSet>
    <!-- <dele :superstratum="superstratum" @queren="quit" @conse="superstratum = false" title="退出登录"></dele> -->
  </div>
</template>
<script>
// import dele from '@/components/dele.vue';
import UserSet from '../components/common/UserSet.vue';
export default {
  name: 'userset',
  components: {
    // dele,
    UserSet
  },
  data() {
    return {
      superstratum: false,
      // 用data判断用户是否登录
      data: ''
    }
  },
  methods: {
    quit() {
      this.superstratum = false
      localStorage.clear()
      this.$router.push('my')
    },
    goback() {
      this.$router.push('/my')
    }
  },
  created() {
    this.data = JSON.parse(localStorage.getItem('data'))
  }
};
</script>
<style lang='scss' scoped></style>